]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Cap scaled floating size to target layout size
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 30 Jul 2020 13:02:18 +0000 (15:02 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 5 Sep 2020 16:12:08 +0000 (16:12 +0000)
A window preview's floating geometry is scaled down according to the
workspace's allocation, while the layout geometry is computed directly
for the available space.

For previews that maintain their real size in the layout geometry,
that scaling leads to a distracting size bounce when transitioning
between both layouts.

Address that by not allowing the scaled floating size to drop below
that layout size (which is at most equal to the unscaled floating size).

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2968

js/ui/workspace.js

index d7e179b1d16c6eccebb037625fb146d1bab8a9a2..ee7cbdc20251e031d3bebea1b11c7c2f15c8acee 100644 (file)
@@ -614,6 +614,11 @@ var WorkspaceLayout = GObject.registerClass({
             }
 
             workspaceBox.scale(allocationScale);
+            // don't allow the scaled floating size to drop below
+            // the target layout size
+            workspaceBox.set_size(
+                Math.max(workspaceBox.get_width(), width),
+                Math.max(workspaceBox.get_height(), height));
 
             layoutBox.x1 = x;
             layoutBox.x2 = layoutBox.x1 + width;